package Ex1;

import java.util.Random;
import java.util.Scanner;

public class Ex03_Q3 {

	
	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		Random random = new Random();
		
		int rr=random.nextInt(999);
		int sc;
		int[] ml = new int [4];
		int[] cl = new int[4];
		int match = 0; //일치 횟수
 		for(int i=1; i<cl.length; i++) //컴퓨터 난수 생성
			cl[i]=(int)(Math.random()*10);
		
		// cl=(int)(Math.random()*1000)+1;
		// 0.123456789 x 1000 = 123
	
			for(int i=1; i<ml.length; i++){
				System.out.println(i+"번째 숫자입력");
				ml[i]=scan.nextInt();
						
			}
	
		//비교
			
			
			
			if(ml[1]==cl[1] || ml[1]==cl[2] || ml[1]==cl[3])++match;
			if(ml[2]==cl[1] || ml[2]==cl[2] || ml[2]==cl[3])++match;
			if(ml[3]==cl[1] || ml[3]==cl[2] || ml[3]==cl[3])++match;
			
		//일치여부에 따라 상금부여	
			
			if(match==1)
				System.out.println("3등당첨");
			else if(match==2)
				System.out.println("2등당첨");
			else if(match==3)
				System.out.println("1등당첨");
			else 
				System.out.println("꽝");
		
			for(int i=1; i<=3; i++)System.out.print("\t추첨번호 :"  +	cl[i]+"\t");
			System.out.print("\n복권번호: ");
			for(int i=1; i<=3; i++)System.out.print(ml[i]+"\t");
	}
}